import { NgModule } from '@angular/core';
import { Routes, RouterModule } from '@angular/router';
import { ConfigComponent } from './pages/config/config.component';
import { DataPermissionManagementComponent } from './pages/data-permission-management/data-permission-management.component';
import { DataPermissionComponent } from './pages/data-permission/data-permission.component';
import { DictComponent } from './pages/dict/dict.component';
import { EmployeeComponent } from './pages/employee/employee.component';
import { FilePermissionComponent } from './pages/file-permission/file-permission.component';
import { FileComponent } from './pages/file/file.component';
import { GroupComponent } from './pages/group/group.component';
import { IndexComponent } from './pages/index/index.component';
import { LevelComponent } from './pages/level/level.component';
import { LogComponent } from './pages/log/log.component';
import { LoginComponent } from './pages/login/login.component';
import { MenuPermissionComponent } from './pages/menu-permission/menu-permission.component';
import { MenuComponent } from './pages/menu/menu.component';
import { ModelAttributePermissionComponent } from './pages/model-attribute-permission/model-attribute-permission.component';
import { ModelAttributeComponent } from './pages/model-attribute/model-attribute.component';
import { ModelPermissionComponent } from './pages/model-permission/model-permission.component';
import { ModelComponent } from './pages/model/model.component';
import { OrganizationComponent } from './pages/organization/organization.component';
import { RoleComponent } from './pages/role/role.component';
import { ScopeComponent } from './pages/scope/scope.component';
import { SerialNumberComponent } from './pages/serial-number/serial-number.component';
import { SparrowAppComponent } from './pages/sparrow-app/sparrow-app.component';
import { SysrolePermissionComponent } from './pages/sysrole-permission/sysrole-permission.component';
import { SysroleComponent } from './pages/sysrole/sysrole.component';
import { UrlPermissionComponent } from './pages/url-permission/url-permission.component';
import { UrlComponent } from './pages/url/url.component';
import { SetDataPermissionComponent } from './share/set-data-permission/set-data-permission.component';
import { SetModelPermissionComponent } from './share/set-model-permission/set-model-permission.component';

const routes: Routes = [
  { path: '', pathMatch: 'full', redirectTo: '/organization' },
  { path: 'login', component: LoginComponent },
  {
    path: 'welcome',
    loadChildren: () =>
      import('./pages/welcome/welcome.module').then((m) => m.WelcomeModule),
  },
  {
    path: 'index',
    component: IndexComponent,
    data: {
      breadcrumb: '后台管理',
    },
  },
  {
    path: 'url',
    component: UrlComponent,
    data: {
      breadcrumb: '接口管理',
    },
  },
  {
    path: 'sparrowApp',
    component: SparrowAppComponent,
    data: {
      breadcrumb: '应用管理',
    },
  },
  {
    path: 'modelPermissionManagement',
    component: ModelPermissionComponent,
    data: {
      breadcrumb: '模型权限管理',
    },
  },
  {
    path: 'modelPermission',
    component: SetModelPermissionComponent,
    data: {
      breadcrumb: '模型授权',
    },
  },
  { path: 'urlPermission', component: UrlPermissionComponent },
  {
    path: 'menu',
    component: MenuComponent,
    data: {
      breadcrumb: '菜单管理',
    },
  },
  {
    path: 'model',
    component: ModelComponent,
    data: {
      breadcrumb: '模型管理',
    },
  },
  { path: 'menuPermission', component: MenuPermissionComponent },
  {
    path: 'modelAttribute',
    component: ModelAttributeComponent,
    data: {
      breadcrumb: '模型属性管理',
    },
  },
  {
    path: 'modelAttributePermission',
    component: ModelAttributePermissionComponent,
  },
  {
    path: 'dataPermission',
    component: SetDataPermissionComponent,
    data: {
      breadcrumb: '数据授权',
    },
  },
  {
    path: 'dataPermissionManagement',
    component: DataPermissionComponent,
    data: {
      breadcrumb: '数据权限管理',
    },
  },
  {
    path: 'filePermission',
    component: FilePermissionComponent,
    data: {
      breadcrumb: '文件权限管理',
    },
  },
  {
    path: 'sysrole',
    component: SysroleComponent,
    data: {
      breadcrumb: '角色管理',
    },
  },
  {
    path: 'scope',
    component: ScopeComponent,
    data: {
      breadcrumb: '功能管理',
    },
  },
  { path: 'sysrolePermission', component: SysrolePermissionComponent },
  {
    path: 'organization',
    component: OrganizationComponent,
    data: {
      breadcrumb: '机构管理',
    },
  },
  {
    path: 'role',
    component: RoleComponent,
    data: {
      breadcrumb: '岗位管理',
    },
  },
  {
    path: 'level',
    component: LevelComponent,
    data: {
      breadcrumb: '级别管理',
    },
  },
  {
    path: 'group',
    component: GroupComponent,
    data: {
      breadcrumb: '群组管理',
    },
  },
  {
    path: 'employee',
    component: EmployeeComponent,
    data: {
      breadcrumb: '员工管理',
    },
  },
  { path: 'file', component: FileComponent },
  {
    path: 'log',
    component: LogComponent,
    data: {
      breadcrumb: '审计日志',
    },
  },
  {
    path: 'dict',
    component: DictComponent,
    data: {
      breadcrumb: '数据字典',
    },
  },
  {
    path: 'serialNumber',
    component: SerialNumberComponent,
    data: {
      breadcrumb: '流水号',
    },
  },
  {
    path: 'config',
    component: ConfigComponent,
    data: {
      breadcrumb: '全局配置',
    },
  },
];

@NgModule({
  imports: [RouterModule.forRoot(routes)],
  exports: [RouterModule],
})
export class AppRoutingModule {}
